package com.visionet.school.app.web.entity.enums;

/**
 * Created by hxpeng on 2017/3/3.
 */
public enum MemberType {

    MAN("1","男"),
    WOMAN("0","女"),
    TEACHER("1","班主任/教师") ,
    PARENT("2","家长") ,
    STUDENT("3","学生");

    private String key;
    private String value;

    MemberType(String key, String value){
        this.key = key;
        this.value = value;
    }

    public static MemberType fromCode(String key){
        for (MemberType type : values()){
            if(type.key.equalsIgnoreCase(key)){
                return type;
            }
        }
        return null;
    }

    public String toKey() {
        return key;
    }

    public String getValue() {
        return value;
    }
}
